package com.example.administrator.activity.General;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.example.administrator.activity.Homework.Homework4.CalaulateActivity;
import com.example.administrator.activity.parcitise.Activity.GoddnessActivity;
import com.example.administrator.activity.Homework.Homework5.Homework5CarrtonListActivity;
import com.example.administrator.activity.parcitise.Activity.MarketListActivity;
import com.example.administrator.activity.parcitise.Activity.RegisterActivity;
import com.example.administrator.activity.R;

public class General_activityActivity extends AppCompatActivity {

    private Button register,goddness,BMI,calculating,market,HomeworkCarrtom;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_general_activity);
        init();

        View.OnClickListener clickListener=new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                switch (v.getId()){
                    case R.id.register:
                        register();
                        break;
                    case R.id.goddness:
                        goddness();
                        break;
                    case R.id.BMI:
                        BMI();
                        break;
                    case R.id.calculating:
                        calculating();
                        break;
                    case R.id.market:
                        market();
                        break;
                    case R.id.carrtom:
                        carrtom();
                        break;
                }
            }
        };
        register.setOnClickListener(clickListener);
        goddness.setOnClickListener(clickListener);
        BMI.setOnClickListener(clickListener);
        calculating.setOnClickListener(clickListener);
        market.setOnClickListener(clickListener);
        HomeworkCarrtom.setOnClickListener(clickListener);
    }


    private void carrtom() {
        Intent intent=new Intent(this,Homework5CarrtonListActivity.class);
        startActivity(intent);
    }

    private void market() {
        Intent intent=new Intent(this,MarketListActivity.class);
        startActivity(intent);
    }

    private void register() {
        Intent intent=new Intent(this,RegisterActivity.class);
        startActivity(intent);
    }

    private void goddness() {
        Intent intent=new Intent(this,GoddnessActivity.class);
        startActivity(intent);
    }

    private void BMI() {
        Intent intent=new Intent(this, com.example.administrator.activity.Homework.Homework4.Homework4_1.BMI.class);
        startActivity(intent);
    }

    private void calculating() {
        Intent intent=new Intent(this,CalaulateActivity.class);
        startActivity(intent);
    }

    private void init() {
        register=findViewById(R.id.register);
        goddness=findViewById(R.id.goddness);
        BMI=findViewById(R.id.BMI);
        calculating=findViewById(R.id.calculating);
        market=findViewById(R.id.market);
        HomeworkCarrtom=findViewById(R.id.carrtom);
    }
}
